package com.threed.fashionShop.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/home")
public class HomeController {
    @RequestMapping("/layout")
    public String getHomeLayout() {
        return "home/home";
    }

    @RequestMapping("/latestProducts.json")
    @ResponseBody
    public List<String> fetchLastestProductList() {
        List<String> listResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
            listResult.add("resources/images/products/p1-209x179.jpg");
        }
        return listResult;
    }
}